/*
 *  Copyright 2025 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
@import (reference) '../../../../../styles/variables.less';
.widget-wrapper-container {
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .ant-card-body {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; // Ensure card body contains all content
    position: relative; // Provide positioning context for absolute elements
  }

  .entity-list-skeleton {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; // Prevent skeleton from overflowing
    flex: 1; // Allow skeleton to take remaining space
  }

  .widget-wrapper-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; // Prevent content from overflowing widget bounds

    // Ensure widget content containers have proper sizing
    .widget-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0; // Allow flex child to shrink
      overflow: hidden;

      // Scrollable content areas within widgets
      .entity-list-body,
      .cards-scroll-container {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
      }

      // Widget footer positioning
      .widget-footer {
        flex-shrink: 0;
        margin-top: auto;
      }
    }
  }

  .widget-wrapper-more-options {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;

    .widget-wrapper-more-button {
      border: none;
      background: transparent;
      transition: color 0.3s ease;

      &:hover {
        color: @primary-color;
      }
    }

    .widget-wrapper-more-menu {
      .ant-dropdown-menu-item {
        padding: 8px 16px;
        font-size: 14px;
        line-height: 20px;
      }
    }
  }
}
